#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int e[21][21][21];

int fun (int a, int b, int c)
{

    if (a <= 0 || b <= 0 || c <= 0) return 1;
    if (a > 20 || b > 20 || c > 20) return fun(20, 20, 20);
    if (a < b && b < c) {
        if (e[a][b][c]) return e[a][b][c];
        else 
            e[a][b][c] = fun(a, b, c-1) + fun(a, b-1, c-1) - fun(a, b-1, c);
    } else {
        if (e[a][b][c]) return e[a][b][c];
        else
            e[a][b][c] = fun(a-1, b, c) + fun(a-1, b-1, c) + fun(a-1, b, c-1) - fun(a-1, b-1, c-1);
    }

    return e[a][b][c];
}

int main (int argc, char const* argv[])
{
    int a, b, c;
    memset(e, 0, sizeof(e));

    while (1) {
        scanf("%d %d %d", &a, &b, &c);
        if (a == -1 && b == -1 && c == -1) {
            break;
        }

        printf("w(%d, %d, %d) = %d\n", a, b, c, fun(a, b, c));
    }

    return 0;
}
